package no.ntnu.item.ttm4120.dhcp.data;

import java.io.Serializable;
import java.net.InetAddress;

public class AddressPoolEntity implements Serializable{

	private static final long serialVersionUID = -8131714167509000458L;
	private InetAddress address;
	private String client;
	/**
	 * When lease would expired (lease_duration + current_time)
	 */
	private long leaseTimeEnd;
	private boolean assigned;
	private int serverPos;
	
	public InetAddress getAddress() {
		return address;
	}
	public void setAddress(InetAddress address) {
		this.address = address;
	}
	public String getClient() {
		return client;
	}
	public void setClient(String client) {
		this.client = client;
	}
	public long getLeaseTimeEnd() {
		return leaseTimeEnd;
	}
	public void setLeaseTimeEnd(long leaseTimeEnd) {
		this.leaseTimeEnd = leaseTimeEnd;
	}
	public void setAssigned(boolean assigned) {
		this.assigned = assigned;
	}
	public boolean isAssigned() {
		return assigned;
	}
	@Override
	public String toString() {
		return "Address: " + address +
				", Client: " + client +
				", LeaseTimeEnd: " + leaseTimeEnd +
				", Assigned: " + assigned +
				", Server: " + serverPos + '\n';
	}
	public void setServer(int serverPos) {
		this.serverPos = serverPos;
	}
	public int getServer() {
		return serverPos;
	}
}
